package cn.iocoder.yudao.framework.region.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  区域类型枚举
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/02/28
 */
@Getter
@AllArgsConstructor
public enum RegionType {

    COUNTRY(-1, "国家"),
    PROVINCE(0, "省份"),
    CITY(1, "城市"),
    COUNTY(2, "区县"),
    ;

    private final Integer value;
    private final String name;

    public static RegionType valueOf(Integer value) {
        for (RegionType type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return COUNTRY;
    }

}
